
<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="zh_cn">
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   
      <title>GM_setValue [&#28145;&#20837;&#27973;&#20986; Greasemonkey]</title>
      <link rel="shortcut icon" href="/favicon.ico">
      <link rel="stylesheet" href="../css/dig.css" type="text/css">
      <meta http-equiv="Link" content='&lt;../css/modern.css&gt;; type="text/css"; rel=stylesheet, &lt;../css/empty.css&gt;; type="text/css";
      rel=stylesheet'>
      <link rev="made" href="mailto:mark@diveintomark.org">
      <meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
      <meta name="keywords" content="Firefox, Greasemonkey, Javascript, user script, userscript">
      <link rel="start" href="../toc/index.html" title="&#28145;&#20837;&#27973;&#20986; Greasemonkey">
      <link rel="up" href="index.html" title="Greasemonkey API &#21442;&#32771;">
      <link rel="prev" href="gm_getvalue.html" title="GM_getValue">
      <link rel="next" href="gm_registermenucommand.html" title="GM_registerMenuCommand">
   </head>
   <body id="diveintogreasemonkey-org" class="api-gmsetvalue">
      <div class="z" id="intro">
         <div class="sectionInner">
            <div class="sectionInner2">
               <div class="s">
                  <h1><a href="/" accesskey="1">&#28145;&#20837;&#27973;&#20986; Greasemonkey</a></h1>
                  <p>&#25945;&#32769;&#32593;&#32476;&#23398;&#26032;&#25226;&#25103;</p>
               </div>
               <div class="s">
                  <ul>
                     <li><a href="../">&#36215;&#22987;&#39029;</a> &middot; 
                     </li>
                     <li><a href="../toc/">&#30446;&#24405;</a> &middot; 
                     </li>
                     <li><a href="../download/">&#19979;&#36733;</a> &middot; 
                     </li>
                     <li><a href="http://greasemonkey.mozdev.org/">&#31435;&#21363;&#19979;&#36733; Greasemonkey</a></li>
                  </ul>
               </div>
            </div>
         </div>
      </div>
      <div id="main">
         <div id="mainInner">
            <p id="breadcrumb">&#24744;&#30340;&#20301;&#32622;&#65306;<a href="../">&#36215;&#22987;&#39029;</a> &#8594; <a href="../toc/index.html">&#30446;&#24405;</a> &#8594; <a href="index.html">Greasemonkey API &#21442;&#32771;</a> &#8594; <span class="thispage">GM_setValue</span></p>
            <div class="refentry" lang="zh_cn"><a name="api.gmsetvalue" class="skip" href="#api.gmsetvalue" title="link to this refentry"><img src="../images/permalink.gif" alt="[link]" title="link to this refentry" width="8" height="9"></a> 
               <div class="titlepage"></div>
               <div class="refnamediv">
                  <h2>&#21517;&#31216;</h2>
                  <p>GM_setValue &#8212; &#35774;&#32622;&#33050;&#26412;&#19987;&#29992;&#30340;&#37197;&#32622;&#20540;</p>
               </div>
               <div class="refsynopsisdiv">
                  <h2>&#22823;&#32434;</h2>
                  <div class="funcsynopsis"><pre class="funcsynopsisinfo"></pre><p><code class="funcdef">function <b class="fsfunc">GM_setValue</b>
                           (</code>
                        <var class="pdparam">key</var>
                        , 
                        <var class="pdparam">value</var>
                        <code>)</code>;
                     </p>
                  </div>
               </div>
               <div class="refsection" lang="zh_cn"><a name="d0e5544" class="skip" href="#d0e5544" title="link to this refsection"><img src="../images/permalink.gif" alt="[link]" title="link to this refsection" width="8" height="9"></a> 
                  
                  <h2>&#25551;&#36848;</h2>
                  
                  <p>
                     <code class="function">GM_setValue</code> &#29992;&#26469;&#23384;&#20648;&#33050;&#26412;&#19987;&#29992;&#30340;&#37197;&#32622;&#20540;&#12290;<em class="parameter"><code>key</code></em> &#21442;&#25968;&#26159;&#26080;&#22266;&#23450;&#26684;&#24335;&#30340;&#23383;&#31526;&#20018;&#12290;<em class="parameter"><code>value</code></em> &#21442;&#25968;&#21487;&#20197;&#26159;&#23383;&#31526;&#20018;&#65292;&#24067;&#23572;&#20540;&#25110;&#32773;&#25972;&#25968;&#12290;&#36825;&#20004;&#20010;&#21442;&#25968;&#37117;&#26159;&#24517;&#38656;&#30340;&#12290;
                  </p>
                  
                  <p>Greasemonkey &#30340;&#37197;&#32622;&#20540;&#19982;&#27983;&#35272;&#22120; cookies &#24456;&#30456;&#20284;&#65292;&#20294;&#20063;&#26377;&#37325;&#35201;&#30340;&#21306;&#21035;&#12290;&#20004;&#32773;&#37117;&#23384;&#25918;&#22312;&#26412;&#22320;&#30005;&#33041;&#20013;&#65292;&#20294;&#26159; cookies &#26159;&#22495;&#21517;&#19987;&#29992;&#30340;&#32780;&#19988;&#21482;&#33021;&#34987;&#21019;&#24314;&#23427;&#20204;&#30340;&#22495;&#21517;&#35775;&#38382;&#65292;Greasemonkey &#37197;&#32622;&#20540;&#26159;&#33050;&#26412;&#19987;&#29992;&#30340;&#32780;&#19988;&#21482;&#33021;&#34987;&#21019;&#24314;&#36825;&#20123;&#21442;&#25968;&#30340;&#33050;&#26412;&#35775;&#38382;(&#19982;&#25191;&#34892;&#29992;&#25143;&#33050;&#26412;&#30340;&#22320;&#22336;&#20063;&#26080;&#20851;)&#12290;&#32780;&#19988;&#19982;
                     cookies &#19981;&#21516;&#30340;&#26159;&#65292;&#37197;&#32622;&#20540;&#32477;&#19981;&#20250;&#21457;&#36865;&#21040;&#36828;&#31243;&#26381;&#21153;&#22120;&#19978;&#21435;&#12290;
                  </p>
                  
               </div>
               <div class="refsection" lang="zh_cn"><a name="d0e5564" class="skip" href="#d0e5564" title="link to this refsection"><img src="../images/permalink.gif" alt="[link]" title="link to this refsection" width="8" height="9"></a> 
                  
                  <h2>&#21382;&#21490;</h2>
                  
                  <p>
                     <code class="function">GM_getValue</code> &#30001; Greasemonkey 0.3 &#24341;&#20837;&#12290;
                  </p>
                  
                  <div class="seealso">
                     <h3>&#21442;&#35265;</h3>
                     <ul>
                        <li>
                           <a href="gm_getvalue.html" title="GM_getValue"><span class="refentrytitle">GM_getValue</span></a>
                           
                        </li>
                     </ul>
                  </div>
                  
               </div>
            </div>
            <div style="float: left">&#8592;&nbsp;<a class="NavigationArrow" href="gm_getvalue.html">GM_getValue</a></div>
            <div style="text-align: right"><a class="NavigationArrow" href="gm_registermenucommand.html">GM_registerMenuCommand</a>&nbsp;&#8594;
            </div>
            <hr style="clear:both">
            <div class="footer">
               <p class="copyright">&#29256;&#26435; &copy; 2005 Mark Pilgrim &middot; <a title="&#21457;&#36865;&#32473;&#25105;&#26377;&#20110;&#27492;&#20070;&#30340;&#21453;&#39304;&#24847;&#35265;" href="mailto:mark@diveintomark.org">mark@diveintomark.org</a> &middot; <a href="../license/gpl.html" title="GNU &#36890;&#29992;&#20844;&#20849;&#35768;&#21487;&#35777;">&#20351;&#29992;&#26465;&#27454;</a></p>
            </div>
         </div>
      </div>
   </body>
</html>